(* Content-type: application/vnd.wolfram.mathematica *)

(*** Wolfram Notebook File ***)
(* http://www.wolfram.com/nb *)

(* CreatedBy='Mathematica 10.4' *)

(*CacheID: 234*)
(* Internal cache information:
NotebookFileLineBreakTest
NotebookFileLineBreakTest
NotebookDataPosition[       158,          7]
NotebookDataLength[     17139,        619]
NotebookOptionsPosition[     13358,        498]
NotebookOutlinePosition[     15378,        553]
CellTagsIndexPosition[     15293,        548]
WindowTitle->FCVariable
WindowFrame->Normal*)

(* Beginning of Notebook Content *)
Notebook[{
Cell[BoxData[GridBox[{
   {Cell["FEYN CALC SYMBOL", "PacletNameCell"], Cell[TextData[Cell[BoxData[
     ActionMenuBox[
      FrameBox[
       InterpretationBox[Cell[TextData[{
         "URL",
         StyleBox[" \[FilledDownTriangle]", "AnchorBarArrow",
          StripOnInput->False]
        }]],
        TextCell[
         Row[{"URL", 
           Style[" \[FilledDownTriangle]", "AnchorBarArrow"]}]]],
       StripOnInput->False], {"\<\"FeynCalc/ref/FCVariable\"\>":>
      None, "\<\"Copy Wolfram Documentation Center URL\"\>":>
      Module[{DocumentationSearch`Private`nb$}, 
       DocumentationSearch`Private`nb$ = NotebookPut[
          Notebook[{
            Cell["FeynCalc/ref/FCVariable"]}, Visible -> False]]; 
       SelectionMove[DocumentationSearch`Private`nb$, All, Notebook]; 
       FrontEndTokenExecute[DocumentationSearch`Private`nb$, "Copy"]; 
       NotebookClose[DocumentationSearch`Private`nb$]; Null], 
      Delimiter, "\<\"Copy web URL\"\>":>
      Module[{DocumentationSearch`Private`nb$}, 
       DocumentationSearch`Private`nb$ = NotebookPut[
          Notebook[{
            Cell[
             BoxData[
              MakeBoxes[
               Hyperlink[
               "http://reference.wolfram.com/language/FeynCalc/ref/FCVariable.\
html"], StandardForm]], "Input", TextClipboardType -> "PlainText"]}, Visible -> 
           False]]; SelectionMove[
        DocumentationSearch`Private`nb$, All, Notebook]; 
       FrontEndTokenExecute[DocumentationSearch`Private`nb$, "Copy"]; 
       NotebookClose[DocumentationSearch`Private`nb$]; 
       Null], "\<\"Go to web URL\"\>":>FrontEndExecute[{
        NotebookLocate[{
          URL[
           StringJoin[
            If[
             TrueQ[DocumentationBuild`Make`Private`wsmlinkQ$129928], 
             "http://reference.wolfram.com/system-modeler/", 
             "http://reference.wolfram.com/language/"], 
            "FeynCalc/ref/FCVariable", ".html"]], None}]}]},
      Appearance->None,
      MenuAppearance->Automatic,
      MenuStyle->"URLMenu"]],
     LineSpacing->{1.4, 0}]], "AnchorBar"]}
  }]], "AnchorBarGrid",
 GridBoxOptions->{GridBoxItemSize->{"Columns" -> {
     Scaled[0.65], {
      Scaled[0.34]}}, "ColumnsIndexed" -> {}, "Rows" -> {{1.}}, 
   "RowsIndexed" -> {}}},
 CellID->1],

Cell[TextData[{
 Cell["FCVariable", "ObjectName"],
 Cell[BoxData[
  InterpretationBox[
   StyleBox[
    GraphicsBox[{},
     BaselinePosition->Baseline,
     ImageSize->{8, 0}],
    CacheGraphics->False],
   Spacer[8]]]],
 Cell[BoxData[""], "ObjectNameTranslation"]
}], "ObjectNameGrid"],

Cell[BoxData[GridBox[{
   {"", Cell[TextData[{
     Cell[BoxData["FCVariable"], "InlineFormula"],
     " \[LineSeparator]",
     " is a data type. E.g. DataType[z, FCVariable] = True."
    }]]}
  }]], "Usage",
 GridBoxOptions->{
 GridBoxBackground->{
  "Columns" -> {{None}}, "ColumnsIndexed" -> {}, "Rows" -> {{None}}, 
   "RowsIndexed" -> {}}},
 CellID->982511436],

Cell[CellGroupData[{

Cell[TextData[{
 Cell[BoxData[
  InterpretationBox[
   StyleBox[
    GraphicsBox[{},
     BaselinePosition->Baseline,
     ImageSize->{6, 0}],
    CacheGraphics->False],
   Spacer[6]]]],
 "Examples",
 "\[NonBreakingSpace]\[NonBreakingSpace]",
 Cell["(1)", "ExampleCount"]
}], "PrimaryExamplesSection",
 WholeCellGroupOpener->True,
 CellTags->"PrimaryExamplesSection",
 CellID->2014718428],

Cell[CellGroupData[{

Cell[TextData[{
 "Basic Examples",
 "\[NonBreakingSpace]\[NonBreakingSpace]",
 Cell["(1)", "ExampleCount"]
}], "ExampleSection", "ExampleSection",
 WholeCellGroupOpener->True,
 CellID->1781802097],

Cell["\<\
If we want to introduce constants c1 and c2, the naive way doesn't lead to \
the desired result\
\>", "Notes",
 CellID->247520490],

Cell[CellGroupData[{

Cell[BoxData[
 RowBox[{
  RowBox[{"SPD", "[", 
   RowBox[{
    RowBox[{
     RowBox[{"c1", " ", "p1"}], "+", 
     RowBox[{"c2", " ", "p2"}]}], ",", "q"}], "]"}], "//", 
  "ExpandScalarProduct"}]], "Input",
 CellLabel->"In[1]:=",
 CellID->1215664914],

Cell[BoxData[
 FormBox[
  RowBox[{
   RowBox[{
    FormBox[
     FormBox[
      RowBox[{"c1", " ", "p1"}],
      TraditionalForm],
     TraditionalForm], 
    FormBox["\<\"\[CenterDot]\"\>",
     TraditionalForm], 
    FormBox[
     FormBox["q",
      TraditionalForm],
     TraditionalForm]}], "+", 
   RowBox[{
    FormBox[
     FormBox[
      RowBox[{"c2", " ", "p2"}],
      TraditionalForm],
     TraditionalForm], 
    FormBox["\<\"\[CenterDot]\"\>",
     TraditionalForm], 
    FormBox[
     FormBox["q",
      TraditionalForm],
     TraditionalForm]}]}], TraditionalForm]], "Output",
 ImageSize->{132, 16},
 ImageMargins->{{0, 0}, {0, 0}},
 ImageRegion->{{0, 1}, {0, 1}},
 CellLabel->"Out[1]=",
 CellID->63183590]
}, Open  ]],

Cell["\<\
The solution is to declare c1 and c2 as FCVariable so that FeynCalc can \
distinguish them from the 4-momenta\
\>", "Notes",
 CellID->1683370483],

Cell[CellGroupData[{

Cell[BoxData[{
 RowBox[{
  RowBox[{
   RowBox[{"DataType", "[", 
    RowBox[{"c1", ",", "FCVariable"}], "]"}], "=", "True"}], ";"}], "\n", 
 RowBox[{
  RowBox[{
   RowBox[{"DataType", "[", 
    RowBox[{"c2", ",", "FCVariable"}], "]"}], "=", "True"}], ";"}], "\n", 
 RowBox[{
  RowBox[{"SPD", "[", 
   RowBox[{
    RowBox[{
     RowBox[{"c1", " ", "p1"}], "+", 
     RowBox[{"c2", " ", "p2"}]}], ",", "q"}], "]"}], "//", 
  "ExpandScalarProduct"}]}], "Input",
 CellLabel->"In[2]:=",
 CellID->1946914218],

Cell[BoxData[
 FormBox[
  RowBox[{
   RowBox[{"c1", " ", 
    RowBox[{"(", 
     RowBox[{
      FormBox[
       FormBox["p1",
        TraditionalForm],
       TraditionalForm], 
      FormBox["\<\"\[CenterDot]\"\>",
       TraditionalForm], 
      FormBox[
       FormBox["q",
        TraditionalForm],
       TraditionalForm]}], ")"}]}], "+", 
   RowBox[{"c2", " ", 
    RowBox[{"(", 
     RowBox[{
      FormBox[
       FormBox["p2",
        TraditionalForm],
       TraditionalForm], 
      FormBox["\<\"\[CenterDot]\"\>",
       TraditionalForm], 
      FormBox[
       FormBox["q",
        TraditionalForm],
       TraditionalForm]}], ")"}]}]}], TraditionalForm]], "Output",
 ImageSize->{156, 16},
 ImageMargins->{{0, 0}, {0, 0}},
 ImageRegion->{{0, 1}, {0, 1}},
 CellLabel->"Out[2]=",
 CellID->425164179]
}, Open  ]],

Cell["This works also for propagator denominators and matrices", "Notes",
 CellID->84688361],

Cell[CellGroupData[{

Cell[BoxData[{
 RowBox[{"FCI", "[", 
  RowBox[{"SFAD", "[", 
   RowBox[{"{", 
    RowBox[{
     RowBox[{"q", "+", 
      RowBox[{"c1", " ", "p1"}]}], ",", "m"}], "}"}], "]"}], 
  "]"}], "\[IndentingNewLine]", 
 RowBox[{"%", "//", "StandardForm"}]}], "Input",
 CellLabel->"In[3]:=",
 CellID->228259200],

Cell[BoxData[
 FormBox[
  FractionBox["1", 
   TemplateBox[{"\"(\"",RowBox[{
       SuperscriptBox[
        RowBox[{
          FormBox["\"(\"", TraditionalForm], 
          FormBox[
           FormBox[
            RowBox[{
              RowBox[{"c1", " ", 
                FormBox["p1", TraditionalForm]}], "+", 
              FormBox["q", TraditionalForm]}], TraditionalForm], 
           TraditionalForm], 
          FormBox["\")\"", TraditionalForm]}], 2]}],RowBox[{"-", "m"}],
     "\"+\"",RowBox[{"\[ImaginaryI]", " ", "\"\[Eta]\""}],"\")\""},
    "RowDefault"]], TraditionalForm]], "Output",
 ImageSize->{161, 40},
 ImageMargins->{{0, 0}, {0, 0}},
 ImageRegion->{{0, 1}, {0, 1}},
 CellLabel->"Out[3]=",
 CellID->365749151],

Cell[BoxData[
 RowBox[{"FeynAmpDenominator", "[", 
  RowBox[{"StandardPropagatorDenominator", "[", 
   RowBox[{
    RowBox[{
     RowBox[{"c1", " ", 
      RowBox[{"Momentum", "[", 
       RowBox[{"p1", ",", "D"}], "]"}]}], "+", 
     RowBox[{"Momentum", "[", 
      RowBox[{"q", ",", "D"}], "]"}]}], ",", "0", ",", 
    RowBox[{"-", "m"}], ",", 
    RowBox[{"{", 
     RowBox[{"1", ",", "1"}], "}"}]}], "]"}], "]"}]], "Output",
 ImageSize->{420, 33},
 ImageMargins->{{0, 0}, {0, 0}},
 ImageRegion->{{0, 1}, {0, 1}},
 CellLabel->"Out[3]//StandardForm=",
 CellID->1642692538]
}, Open  ]],

Cell[CellGroupData[{

Cell[BoxData[{
 RowBox[{
  RowBox[{
   RowBox[{"GAD", "[", "\[Mu]", "]"}], ".", 
   RowBox[{"(", 
    RowBox[{
     RowBox[{"GSD", "[", 
      RowBox[{"c1", " ", "p"}], "]"}], "+", "m"}], ")"}], ".", 
   RowBox[{"GAD", "[", "\[Nu]", "]"}]}], "//", "FCI"}], "\[IndentingNewLine]", 
 RowBox[{"%", "//", "StandardForm"}]}], "Input",
 CellLabel->"In[4]:=",
 CellID->1015735328],

Cell[BoxData[
 FormBox[
  RowBox[{
   SuperscriptBox["\[Gamma]", 
    FormBox[
     FormBox["\[Mu]",
      TraditionalForm],
     TraditionalForm]], ".", 
   RowBox[{"(", 
    RowBox[{
     RowBox[{"c1", " ", 
      RowBox[{"\[Gamma]", "\[CenterDot]", 
       FormBox[
        FormBox["p",
         TraditionalForm],
        TraditionalForm]}]}], "+", "m"}], ")"}], ".", 
   SuperscriptBox["\[Gamma]", 
    FormBox[
     FormBox["\[Nu]",
      TraditionalForm],
     TraditionalForm]]}], TraditionalForm]], "Output",
 ImageSize->{143, 16},
 ImageMargins->{{0, 0}, {0, 0}},
 ImageRegion->{{0, 1}, {0, 1}},
 CellLabel->"Out[4]=",
 CellID->2133407116],

Cell[BoxData[
 RowBox[{
  RowBox[{"DiracGamma", "[", 
   RowBox[{
    RowBox[{"LorentzIndex", "[", 
     RowBox[{"\[Mu]", ",", "D"}], "]"}], ",", "D"}], "]"}], ".", 
  RowBox[{"(", 
   RowBox[{"m", "+", 
    RowBox[{"c1", " ", 
     RowBox[{"DiracGamma", "[", 
      RowBox[{
       RowBox[{"Momentum", "[", 
        RowBox[{"p", ",", "D"}], "]"}], ",", "D"}], "]"}]}]}], ")"}], ".", 
  RowBox[{"DiracGamma", "[", 
   RowBox[{
    RowBox[{"LorentzIndex", "[", 
     RowBox[{"\[Nu]", ",", "D"}], "]"}], ",", "D"}], "]"}]}]], "Output",
 ImageSize->{318, 50},
 ImageMargins->{{0, 0}, {0, 0}},
 ImageRegion->{{0, 1}, {0, 1}},
 CellLabel->"Out[4]//StandardForm=",
 CellID->2114556516]
}, Open  ]],

Cell[CellGroupData[{

Cell[BoxData[{
 RowBox[{
  RowBox[{
   RowBox[{"CSI", "[", "i", "]"}], ".", 
   RowBox[{"CSIS", "[", 
    RowBox[{"c1", " ", "p"}], "]"}], ".", 
   RowBox[{"CSI", "[", "j", "]"}]}], "//", "FCI"}], "\[IndentingNewLine]", 
 RowBox[{"%", "//", "StandardForm"}]}], "Input",
 CellLabel->"In[5]:=",
 CellID->897525840],

Cell[BoxData[
 FormBox[
  RowBox[{
   SuperscriptBox[
    OverscriptBox[
     FormBox[
      StyleBox["\<\"\[Sigma]\"\>",
       StripOnInput->False,
       FontWeight->Bold],
      TraditionalForm], "_"], 
    FormBox[
     FormBox[
      StyleBox["i",
       StripOnInput->False,
       FontWeight->Bold],
      TraditionalForm],
     TraditionalForm]], ".", 
   RowBox[{"(", 
    RowBox[{"c1", " ", 
     RowBox[{
      OverscriptBox[
       FormBox[
        StyleBox["\<\"\[Sigma]\"\>",
         StripOnInput->False,
         FontWeight->Bold],
        TraditionalForm], "_"], "\[CenterDot]", 
      FormBox[
       OverscriptBox[
        FormBox[
         StyleBox["p",
          StripOnInput->False,
          FontWeight->Bold],
         TraditionalForm], "_"],
       TraditionalForm]}]}], ")"}], ".", 
   SuperscriptBox[
    OverscriptBox[
     FormBox[
      StyleBox["\<\"\[Sigma]\"\>",
       StripOnInput->False,
       FontWeight->Bold],
      TraditionalForm], "_"], 
    FormBox[
     FormBox[
      StyleBox["j",
       StripOnInput->False,
       FontWeight->Bold],
      TraditionalForm],
     TraditionalForm]]}], TraditionalForm]], "Output",
 ImageSize->{122, 19},
 ImageMargins->{{0, 0}, {0, 0}},
 ImageRegion->{{0, 1}, {0, 1}},
 CellLabel->"Out[5]=",
 CellID->825817380],

Cell[BoxData[
 RowBox[{
  RowBox[{"PauliSigma", "[", 
   RowBox[{"CartesianIndex", "[", "i", "]"}], "]"}], ".", 
  RowBox[{"(", 
   RowBox[{"c1", " ", 
    RowBox[{"PauliSigma", "[", 
     RowBox[{"CartesianMomentum", "[", "p", "]"}], "]"}]}], ")"}], ".", 
  RowBox[{"PauliSigma", "[", 
   RowBox[{"CartesianIndex", "[", "j", "]"}], "]"}]}]], "Output",
 ImageSize->{557, 33},
 ImageMargins->{{0, 0}, {0, 0}},
 ImageRegion->{{0, 1}, {0, 1}},
 CellLabel->"Out[5]//StandardForm=",
 CellID->19578284]
}, Open  ]],

Cell["To undo the declarations use", "Notes",
 CellID->874852462],

Cell[CellGroupData[{

Cell[BoxData[{
 RowBox[{
  RowBox[{"DataType", "[", 
   RowBox[{"c1", ",", "FCVariable"}], "]"}], "=", 
  "False"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"DataType", "[", 
   RowBox[{"c2", ",", "FCVariable"}], "]"}], "=", "False"}]}], "Input",
 CellLabel->"In[6]:=",
 CellID->219796287],

Cell[BoxData[
 FormBox["False", TraditionalForm]], "Output",
 ImageSize->{34, 14},
 ImageMargins->{{0, 0}, {0, 0}},
 ImageRegion->{{0, 1}, {0, 1}},
 CellLabel->"Out[6]=",
 CellID->1930979781],

Cell[BoxData[
 FormBox["False", TraditionalForm]], "Output",
 ImageSize->{34, 14},
 ImageMargins->{{0, 0}, {0, 0}},
 ImageRegion->{{0, 1}, {0, 1}},
 CellLabel->"Out[6]=",
 CellID->1284707712]
}, Open  ]],

Cell[BoxData[""], "Input",
 CellLabel->"In[7]:=",
 CellID->58122944]
}, Open  ]]
}, Open  ]],

Cell[" ", "FooterCell"]
},
Saveable->False,
ScreenStyleEnvironment->"Working",
WindowSize->{725, 750},
WindowMargins->{{-10, Automatic}, {Automatic, -8}},
WindowTitle->"FCVariable",
TaggingRules->{
 "ModificationHighlight" -> False, "ColorType" -> "SymbolColor", "LinkTrails" -> 
  GridBox[{{
      RowBox[{
        ButtonBox[
        "FeynCalc", ButtonData -> "paclet:FeynCalc/guide/FeynCalc", 
         BaseStyle -> {"Link", "DockedLinkTrail"}]}]}}, ColumnAlignments -> 
    Left], "HasOptions" -> False, "ExampleCounter" -> 1, "NeedPlatMsgIn" -> 
  None, "RootCaptions" -> "", 
  "Metadata" -> {
   "built" -> "{2020, 6, 20, 19, 6, 31.324824}", 
    "history" -> {"9.3", "", "", ""}, "context" -> "FeynCalc`", 
    "keywords" -> {}, "specialkeywords" -> {}, 
    "tutorialcollectionlinks" -> {}, "index" -> True, "label" -> 
    "Feyn Calc Symbol", "language" -> "en", "paclet" -> "FeynCalc", "status" -> 
    "None", "summary" -> 
    "FCVariable is a data type. E.g. DataType[z, FCVariable] = True.", 
    "synonyms" -> {}, "tabletags" -> {}, "title" -> "FCVariable", 
    "titlemodifier" -> "", "windowtitle" -> "FCVariable", "type" -> "Symbol", 
    "uri" -> "FeynCalc/ref/FCVariable"}, "SearchTextTranslated" -> ""},
CellContext->"Global`",
FrontEndVersion->"10.4 for Linux x86 (64-bit) (April 11, 2016)",
StyleDefinitions->Notebook[{
   Cell[
    StyleData[
    StyleDefinitions -> FrontEnd`FileName[{"Wolfram"}, "Reference.nb"]]], 
   Cell[
    StyleData["Input"], CellContext -> "Global`"], 
   Cell[
    StyleData["Output"], CellContext -> "Global`"]}, Visible -> False, 
  FrontEndVersion -> "10.4 for Linux x86 (64-bit) (April 11, 2016)", 
  StyleDefinitions -> "Default.nb"]
]
(* End of Notebook Content *)

(* Internal cache information *)
(*CellTagsOutline
CellTagsIndex->{
 "PrimaryExamplesSection"->{
  Cell[3547, 104, 388, 15, 31, "PrimaryExamplesSection",
   CellTags->"PrimaryExamplesSection",
   CellID->2014718428]}
 }
*)
(*CellTagsIndex
CellTagsIndex->{
 {"PrimaryExamplesSection", 15149, 541}
 }
*)
(*NotebookFileOutline
Notebook[{
Cell[582, 21, 2281, 53, 53, "AnchorBarGrid",
 CellID->1],
Cell[2866, 76, 287, 11, 45, "ObjectNameGrid"],
Cell[3156, 89, 366, 11, 85, "Usage",
 CellID->982511436],
Cell[CellGroupData[{
Cell[3547, 104, 388, 15, 31, "PrimaryExamplesSection",
 CellTags->"PrimaryExamplesSection",
 CellID->2014718428],
Cell[CellGroupData[{
Cell[3960, 123, 196, 6, 26, "ExampleSection",
 CellID->1781802097],
Cell[4159, 131, 140, 4, 32, "Notes",
 CellID->247520490],
Cell[CellGroupData[{
Cell[4324, 139, 250, 9, 27, "Input",
 CellID->1215664914],
Cell[4577, 150, 721, 31, 37, "Output",
 CellID->63183590]
}, Open  ]],
Cell[5313, 184, 155, 4, 48, "Notes",
 CellID->1683370483],
Cell[CellGroupData[{
Cell[5493, 192, 502, 17, 62, "Input",
 CellID->1946914218],
Cell[5998, 211, 810, 33, 37, "Output",
 CellID->425164179]
}, Open  ]],
Cell[6823, 247, 92, 1, 32, "Notes",
 CellID->84688361],
Cell[CellGroupData[{
Cell[6940, 252, 301, 10, 45, "Input",
 CellID->228259200],
Cell[7244, 264, 728, 21, 61, "Output",
 CellID->365749151],
Cell[7975, 287, 574, 17, 69, "Output",
 CellID->1642692538]
}, Open  ]],
Cell[CellGroupData[{
Cell[8586, 309, 373, 11, 45, "Input",
 CellID->1015735328],
Cell[8962, 322, 648, 25, 37, "Output",
 CellID->2133407116],
Cell[9613, 349, 679, 21, 86, "Output",
 CellID->2114556516]
}, Open  ]],
Cell[CellGroupData[{
Cell[10329, 375, 312, 9, 45, "Input",
 CellID->897525840],
Cell[10644, 386, 1292, 52, 40, "Output",
 CellID->825817380],
Cell[11939, 440, 496, 14, 69, "Output",
 CellID->19578284]
}, Open  ]],
Cell[12450, 457, 65, 1, 32, "Notes",
 CellID->874852462],
Cell[CellGroupData[{
Cell[12540, 462, 293, 9, 45, "Input",
 CellID->219796287],
Cell[12836, 473, 191, 6, 35, "Output",
 CellID->1930979781],
Cell[13030, 481, 191, 6, 35, "Output",
 CellID->1284707712]
}, Open  ]],
Cell[13236, 490, 68, 2, 27, "Input",
 CellID->58122944]
}, Open  ]]
}, Open  ]],
Cell[13331, 496, 23, 0, 41, "FooterCell"]
}
]
*)

(* End of internal cache information *)

